﻿using System.Collections.Generic;
using System.Linq;
using FlowCanvas;
using FlowCanvas.Nodes;
using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class DestroyAllBoxTrigger : CallableActionNode
    {
        public override void Invoke()
        {
            List<string> keyList = new List<string>();
            foreach (var pair in BoxTrigger.BlueprintTriggers)
            {
                keyList.Add(pair.Key);
            }
            foreach (var ele in keyList)
            {
                GameObject.Destroy(BoxTrigger.BlueprintTriggers[ele].gameObject);
                BoxTrigger.BlueprintTriggers.Remove(ele);
            }
        }
    }
}
